home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 52
/
Volume 52 - JOGO DISK .iso
/
Games
/
scoobycastillotenebroso.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2007-10-01
|
5KB
|
184 lines
function CN_Game_Object()
{
this.timedScreenArray = new Array();
this.depth_i = 0;
this.offScreenOffset = 700;
this.curScreen = null;
}
function CN_Timer(screen, parent, endTime)
{
this.screen = screen;
this.mc = screen.mc.timer;
this.parent = parent;
this.mc.caller = this;
this.endTime = endTime * 1000;
this.active = false;
}
CN_Game_Object.prototype.Continue = function()
{
if(this.curScreen != null)
{
this.RemoveScreen(this.curScreen);
}
if(this.timedScreenArray.length == 0)
{
gotoAndStop(7);
}
else
{
this.curScreen = this.timedScreenArray.shift();
this.ShowScreen(this.curScreen);
gotoAndStop(6);
}
};
CN_Game_Object.prototype.ExternalGraphicsAreLoaded = function()
{
var allLoaded = true;
var i = 0;
while(i < this.timedScreenArray.length)
{
if(!this.timedScreenArray[i].isLoaded)
{
allLoaded = false;
break;
}
i++;
}
return allLoaded;
};
CN_Game_Object.prototype.GetExternalParameters = function()
{
if(_root.sw1 != null)
{
this.timedScreenArray[0] = new Object();
this.timedScreenArray[0].path = _root.sw1;
this.timedScreenArray[0].duration = _root.sw2;
this.timedScreenArray[0].link = _root.sw4;
}
if(_root.sw5 == 1)
{
var array_i = this.timedScreenArray.length;
this.timedScreenArray[array_i] = new Object();
if(_root.sw5 != 1)
{
this.timedScreenArray[array_i].path = _root.sw5;
}
else
{
this.timedScreenArray[array_i].path = "orbitPowered/orbitPowered.swf";
}
if(_root.sw6 != null)
{
this.timedScreenArray[array_i].duration = _root.sw6;
}
else
{
this.timedScreenArray[array_i].duration = "3";
}
if(_root.sw7 != null)
{
this.timedScreenArray[array_i].link = _root.sw7;
}
else
{
this.timedScreenArray[array_i].link = null;
}
}
var array_i = this.timedScreenArray.length;
var next_i = 8;
while(_root["sw" + next_i] != null)
{
this.timedScreenArray[array_i] = new Object();
this.timedScreenArray[array_i].path = _root["sw" + next_i];
if(_root.sw6 != null)
{
this.timedScreenArray[array_i].duration = _root["sw" + ++next_i];
}
else
{
this.timedScreenArray[array_i].duration = "5";
}
if(_root.sw7 != null)
{
this.timedScreenArray[array_i].link = _root["sw" + ++next_i];
}
else
{
this.timedScreenArray[array_i].link = null;
}
array_i++;
next_i++;
}
};
CN_Game_Object.prototype.LaunchOrbitPopup = function()
{
if(_root.sw5 == 1)
{
getUrl("javascript:popupOrbitCode( )", "");
}
};
CN_Game_Object.prototype.LoadExternalGraphic = function(screen, depth)
{
_root.attachMovie("externalFileHolder","holder" + depth,depth);
screen.mc = _root["holder" + depth];
screen.mc.caller = screen;
screen.mc.slot.loadMovie(screen.path);
};
CN_Game_Object.prototype.MainMovieIsLoaded = function()
{
if(_root.getBytesLoaded() == _root.getBytesTotal())
{
return true;
}
return false;
};
CN_Game_Object.prototype.PreloadExternalGraphics = function()
{
var i = 0;
while(i < this.timedScreenArray.length)
{
this.LoadExternalGraphic(this.timedScreenArray[i],i + 1);
this.timedScreenArray[i].mc._x = this.offScreenOffset;
i++;
}
};
CN_Game_Object.prototype.RemoveScreen = function(screen)
{
screen.mc.slot.unloadMovie();
screen.mc.removeMovieClip();
delete screen;
};
CN_Game_Object.prototype.ShowScreen = function(screen)
{
screen.mc._x = 0;
screen.mc._y = 0;
screen.timer = new CN_Timer(screen,this,screen.duration);
screen.timer.Start();
};
CN_Game_Object.prototype.toString = function()
{
return "CN_Game_Object";
};
CN_Timer.prototype.Start = function()
{
this.active = true;
this.startTime = getTimer();
};
CN_Timer.prototype.Tick = function()
{
if(getTimer() - this.startTime >= this.endTime)
{
_root.EndTimerAdapter(this.parent);
this.active = false;
}
};
CN_Timer.prototype.toString = function()
{
return "CN_Timer";
};
EndTimerAdapter = function(parent)
{
parent.Continue();
};
myGameObject = new CN_Game_Object();